package com.gitee.dubboOps.model;

import org.apache.commons.lang3.exception.ExceptionUtils;

import java.io.Serializable;
import java.util.concurrent.ConcurrentHashMap;


// 实时同步ZK注册中心
public class RedisServiceModel implements Serializable {
    private static final long serialVersionUID = 3203344602975624663L;

    private String rediskey;

    private ConcurrentHashMap<String, ServiceDO> stringServiceDOMAP;

    public ConcurrentHashMap<String, ServiceDO> getStringServiceDOMAP() throws Exception{
        try {
                return stringServiceDOMAP;
           // return Gson.class.newInstance().fromJson(this.json, stringServiceDOMAP.getClass());
        } catch (Exception e) {
            throw new Exception("getStringServiceDOMAP Error: "+ ExceptionUtils.getStackTrace(e));
        }

    }

    private String json;

    public void setStringServiceDOMAP(ConcurrentHashMap<String, ServiceDO> stringServiceDOMAP) throws Exception {
        try {
            //    return stringServiceDOMAP;
            //   this.stringServiceDOMAP = stringServiceDOMAP;
          //  this.json = Gson.class.newInstance().toJson(stringServiceDOMAP);
            this.stringServiceDOMAP = stringServiceDOMAP;
        } catch (Exception e) {
            throw new Exception("setStringServiceDOMAP Error: "+ ExceptionUtils.getStackTrace(e));
        }
    }


    public String getRediskey() {
        return rediskey;
    }

    public void setRediskey(String rediskey) {
        this.rediskey = rediskey;
    }

}
